home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / xview / segal / threshold_stubs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-22  |  10.2 KB  |  517 lines

  1. /*
  2.  * threshold_stubs.c - Notify and event callback function stubs.
  3.  * This file was generated by `gxv' from `threshold.G'.
  4.  */
  5.  
  6. #include "common.h"
  7. #include <stdio.h>
  8. #include <sys/param.h>
  9. #include <sys/types.h>
  10. #include <xview/xview.h>
  11. #include <xview/panel.h>
  12. #include <xview/textsw.h>
  13. #include <xview/xv_xrect.h>
  14. #include "segal.h"
  15. #include <group.h>
  16.  
  17. /*
  18.  * Notify callback function for `set_roi'.
  19.  */
  20. void
  21. threshold_pop_threshold_set_roi_notify_callback(item, value, event)
  22.     Panel_item    item;
  23.     int        value;
  24.     Event        *event;
  25. {
  26.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  27.     
  28.     
  29.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  30.  
  31.     if (value == 4)
  32.     {
  33.         threshold.roi = R3d_CUBE;
  34.         refresh_histogram();
  35.     }
  36.     
  37.     if (value == 5)
  38.     {
  39.         threshold.roi = R3d_PT_LIST;
  40.         refresh_histogram();
  41.     }
  42.     
  43.     if (value == 3)
  44.     {
  45.         threshold.roi = R3d_WHOLE;
  46.         refresh_histogram();
  47.     }
  48.     
  49.     if (value == 1)
  50.     {
  51.         threshold.roi = R2d_CROP;
  52.         refresh_histogram();
  53.     }
  54.     
  55.     if (value == 2)
  56.     {
  57.         threshold.roi = R2d_PT_LIST;
  58.         refresh_histogram();
  59.     }
  60.     
  61.     if (value == 0)
  62.     {
  63.         threshold.roi = R2d_WHOLE;
  64.         refresh_histogram();
  65.     }
  66.     
  67.     /* gxv_end_connections */
  68.  
  69. }
  70.  
  71. /*
  72.  * Notify callback function for `set_effect'.
  73.  */
  74. void
  75. threshold_pop_threshold_set_effect_notify_callback(item, value, event)
  76.     Panel_item    item;
  77.     int        value;
  78.     Event        *event;
  79. {
  80.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  81.     
  82.     
  83.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  84.     /* gxv_end_connections */
  85.  
  86. }
  87.  
  88. /*
  89.  * Notify callback function for `but_max_down'.
  90.  */
  91. void
  92. threshold_pop_threshold_but_max_down_notify_callback(item, event)
  93.     Panel_item    item;
  94.     Event        *event;
  95. {
  96.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  97.     
  98.     
  99.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  100.  
  101.     {
  102.         if(threshold.max > threshold.min) {
  103.             erase_thresh_bounds();
  104.             threshold.max--;
  105.             draw_thresh_bounds();
  106.         }
  107.         
  108.     }
  109.     
  110.     /* gxv_end_connections */
  111.  
  112. }
  113.  
  114. /*
  115.  * Notify callback function for `but_max_up'.
  116.  */
  117. void
  118. threshold_pop_threshold_but_max_up_notify_callback(item, event)
  119.     Panel_item    item;
  120.     Event        *event;
  121. {
  122.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  123.     
  124.     
  125.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  126.  
  127.     {
  128.         if(threshold.max < 255) {
  129.             erase_thresh_bounds();
  130.             threshold.max++;
  131.             draw_thresh_bounds();
  132.         }
  133.     }
  134.     
  135.     /* gxv_end_connections */
  136.  
  137. }
  138.  
  139. /*
  140.  * Notify callback function for `but_min_down'.
  141.  */
  142. void
  143. threshold_pop_threshold_but_min_down_notify_callback(item, event)
  144.     Panel_item    item;
  145.     Event        *event;
  146. {
  147.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  148.     
  149.     
  150.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  151.  
  152.     {
  153.         if(threshold.min > 0) {
  154.             erase_thresh_bounds();
  155.             threshold.min--;
  156.             draw_thresh_bounds();
  157.         }
  158.     }
  159.     
  160.     /* gxv_end_connections */
  161.  
  162. }
  163.  
  164. /*
  165.  * Notify callback function for `but_min_up'.
  166.  */
  167. void
  168. threshold_pop_threshold_but_min_up_notify_callback(item, event)
  169.     Panel_item    item;
  170.     Event        *event;
  171. {
  172.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  173.     
  174.     
  175.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  176.  
  177.     {
  178.         if(threshold.min < threshold.max) {
  179.             erase_thresh_bounds();
  180.             threshold.min++;
  181.             draw_thresh_bounds();
  182.         }
  183.     }
  184.     
  185.     /* gxv_end_connections */
  186.  
  187. }
  188.  
  189. /*
  190.  * Notify callback function for `but_threshold'.
  191.  */
  192. void
  193. threshold_pop_threshold_but_threshold_notify_callback(item, event)
  194.     Panel_item    item;
  195.     Event        *event;
  196. {
  197.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  198.     
  199.     
  200.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  201.     /* gxv_end_connections */
  202.  
  203. }
  204.  
  205. /*
  206.  * Notify callback function for `but_close'.
  207.  */
  208. void
  209. threshold_pop_threshold_but_close_notify_callback(item, event)
  210.     Panel_item    item;
  211.     Event        *event;
  212. {
  213.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  214.     
  215.     
  216.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  217.  
  218.     xv_set(Threshold_pop_threshold->pop_threshold, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
  219.     xv_set(Threshold_pop_threshold->pop_threshold, XV_SHOW, FALSE, NULL);
  220.     
  221.     /* gxv_end_connections */
  222.  
  223. }
  224.  
  225. /*
  226.  * Event callback function for `canvas'.
  227.  */
  228. Notify_value
  229. threshold_pop_threshold_canvas_event_callback(win, event, arg, type)
  230.     Xv_window    win;
  231.     Event        *event;
  232.     Notify_arg    arg;
  233.     Notify_event_type type;
  234. {
  235.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(xv_get(win, CANVAS_PAINT_CANVAS_WINDOW), XV_KEY_DATA, INSTANCE);
  236.     
  237.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  238.  
  239.     {
  240.         thresh_event(event);
  241.     }
  242.     
  243.     /* gxv_end_connections */
  244.  
  245.     return notify_next_event_func(win, (Notify_event) event, arg, type);
  246. }
  247.  
  248. /*
  249.  * Notify callback function for `but_black_image'.
  250.  */
  251. void
  252. threshold_pop_threshold_but_black_image_notify_callback(item, event)
  253.     Panel_item    item;
  254.     Event        *event;
  255. {
  256.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  257.     
  258.     
  259.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  260.     /* gxv_end_connections */
  261.  
  262. }
  263.  
  264. /*
  265.  * Notify callback function for `but_white_image'.
  266.  */
  267. void
  268. threshold_pop_threshold_but_white_image_notify_callback(item, event)
  269.     Panel_item    item;
  270.     Event        *event;
  271. {
  272.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  273.     
  274.     
  275.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  276.     /* gxv_end_connections */
  277.  
  278. }
  279.  
  280. /*
  281.  * Notify callback function for `set_plane'.
  282.  */
  283. void
  284. threshold_pop_threshold_set_plane_notify_callback(item, value, event)
  285.     Panel_item    item;
  286.     int        value;
  287.     Event        *event;
  288. {
  289.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  290.     
  291.     fprintf(stderr, "segal: threshold_pop_threshold_set_plane_notify_callback: value: %u\n", value);
  292.     
  293.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  294.  
  295.     if (value == 3)
  296.     {
  297.         threshold.plane = BP;
  298.         refresh_histogram();
  299.     }
  300.     
  301.     if (value == 2)
  302.     {
  303.         threshold.plane = GP;
  304.         refresh_histogram();
  305.     }
  306.     
  307.     if (value == 1)
  308.     {
  309.         threshold.plane = RP;
  310.         refresh_histogram();
  311.     }
  312.     
  313.     if (value == 0)
  314.     {
  315.         threshold.plane = VAL_RGB;
  316.         refresh_histogram();
  317.     }
  318.     
  319.     /* gxv_end_connections */
  320.  
  321. }
  322.  
  323. /*
  324.  * Notify callback function for `set_mask_effect'.
  325.  */
  326. void
  327. threshold_pop_threshold_set_mask_effect_notify_callback(item, value, event)
  328.     Panel_item    item;
  329.     int        value;
  330.     Event        *event;
  331. {
  332.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  333.     
  334.     fprintf(stderr, "segal: threshold_pop_threshold_set_mask_effect_notify_callback: value: %u\n", value);
  335.     
  336.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  337.  
  338.     if (value == 1)
  339.     {
  340.         threshold.mask_effect = THRESH_ADD_TO;
  341.     }
  342.     
  343.     if (value == 0)
  344.     {
  345.         threshold.mask_effect = THRESH_OVERWRITE;
  346.     }
  347.     
  348.     if (value == 2)
  349.     {
  350.         threshold.mask_effect = THRESH_REMOVE_FROM;
  351.     }
  352.     
  353.     /* gxv_end_connections */
  354.  
  355. }
  356.  
  357. /*
  358.  * Notify callback function for `but_threshold_mask'.
  359.  */
  360. void
  361. threshold_pop_threshold_but_threshold_mask_notify_callback(item, event)
  362.     Panel_item    item;
  363.     Event        *event;
  364. {
  365.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  366.     
  367.     
  368.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  369.  
  370.     {
  371.         threshold_mask();
  372.     }
  373.     
  374.     /* gxv_end_connections */
  375.  
  376. }
  377.  
  378. /*
  379.  * Notify callback function for `set_image_effect'.
  380.  */
  381. void
  382. threshold_pop_threshold_set_image_effect_notify_callback(item, value, event)
  383.     Panel_item    item;
  384.     int        value;
  385.     Event        *event;
  386. {
  387.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  388.     
  389.     fprintf(stderr, "segal: threshold_pop_threshold_set_image_effect_notify_callback: value: %u\n", value);
  390.     
  391.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  392.  
  393.     if (value == 0)
  394.     {
  395.         threshold.image_effect = -1 * threshold.degree;
  396.     }
  397.     
  398.     if (value == 1)
  399.     {
  400.         threshold.image_effect = threshold.degree;
  401.     }
  402.     
  403.     /* gxv_end_connections */
  404.  
  405. }
  406.  
  407. /*
  408.  * Notify callback function for `but_threshold_image'.
  409.  */
  410. void
  411. threshold_pop_threshold_but_threshold_image_notify_callback(item, event)
  412.     Panel_item    item;
  413.     Event        *event;
  414. {
  415.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  416.     
  417.     
  418.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  419.  
  420.     {
  421.         threshold_image();
  422.     }
  423.     
  424.     /* gxv_end_connections */
  425.  
  426. }
  427.  
  428. /*
  429.  * Notify callback function for `set_degree'.
  430.  */
  431. void
  432. threshold_pop_threshold_set_degree_notify_callback(item, value, event)
  433.     Panel_item    item;
  434.     int        value;
  435.     Event        *event;
  436. {
  437.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  438.     
  439.     fprintf(stderr, "segal: threshold_pop_threshold_set_degree_notify_callback: value: %d\n", value);
  440.     
  441.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  442.  
  443.     {
  444.         threshold.degree = value;
  445.         if(threshold.image_effect < 0)
  446.             threshold.image_effect = -1 * threshold.degree;
  447.         else threshold.image_effect = threshold.degree;
  448.     }
  449.     
  450.     /* gxv_end_connections */
  451.  
  452. }
  453.  
  454. /*
  455.  * Notify callback function for `but_histoeq'.
  456.  */
  457. void
  458. threshold_pop_threshold_but_histoeq_notify_callback(item, event)
  459.     Panel_item    item;
  460.     Event        *event;
  461. {
  462.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  463.     
  464.     
  465.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  466.  
  467.     {
  468.         histoeq();
  469.     }
  470.     
  471.     /* gxv_end_connections */
  472.  
  473. }
  474.  
  475. /*
  476.  * Notify callback function for `but_refresh'.
  477.  */
  478. void
  479. threshold_pop_threshold_but_refresh_notify_callback(item, event)
  480.     Panel_item    item;
  481.     Event        *event;
  482. {
  483.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  484.     
  485.     
  486.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  487.  
  488.     {
  489.         draw_histogram();
  490.         draw_thresh_bounds();
  491.     }
  492.     
  493.     /* gxv_end_connections */
  494.  
  495. }
  496.  
  497. /*
  498.  * Notify callback function for `but_stats'.
  499.  */
  500. void
  501. threshold_pop_threshold_but_stats_notify_callback(item, event)
  502.     Panel_item    item;
  503.     Event        *event;
  504. {
  505.     threshold_pop_threshold_objects *ip = (threshold_pop_threshold_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  506.     
  507.     
  508.     /* gxv_start_connections DO NOT EDIT THIS SECTION */
  509.  
  510.     {
  511.         draw_histo_stats();
  512.     }
  513.     
  514.     /* gxv_end_connections */
  515.  
  516. }
  517.